Description of MATLAB codes and data files for the paper:

"Commodity Prices, Convenience Yields and Inflation"
by Nikolay Gospodinov and Serena Ng
Review of Economics and Statistics, Volume 95, Issue 1 [March 2013] 

1. Description of MATLAB codes

MATLAB codes for replicating Tables 1-9 and Figures 1-2 in the paper
 Tables_1_2_8.m (Tables 1, 2 and 8 and Figure 1)
 Table3.m       (Table 3)
 Table4.m       (Table 4)
 Table5.m       (Table 5)
 Table6.m       (Table 6)
 Table7.m       (Table 7)
 Table9.m       (Table 9)
 Figure2.m      (Figure 2)

Supplemental MATLAB codes (utilities)
 pc.m                   (principal component estimation)
 hpdetrend.m            (Hodrick-Prescott detrending)
 onesided_ma.m          (one-sided MA detrending)
 standard.m             (standardizing a variable to have mean 0 and variance 1)
 nwest.m                (regression with Newey-West standard errors;
                         from Spatial Econometrics by James LeSage)
 nw.m                   (Newey-West estimate of covariance matrix with 
 	                 possible automatic lag selection and prewhitening)
 blockind.m             (index for block bootstrap)
 cols.m, rows.m, seqa.m (columns, rows and sequence of integers)



2. Data description

Note: Due to the proprietary nature of the futures commodity price
data, purchased from CRB, we provide only data for the constructed
convenience yields and detrended real commodity prices which are
sufficient to replicate all of the results reported in the paper.

Data (ASCII) files for convenience yields (in local currency):
 cyj.dat     (USA)
 cyj_can.dat (Canada)
 cyj_jap.dat (Japan)
 cyj_fra.dat (France),
 cyj_ger.dat (Germany)
 cyj_ita.dat (Italy)
 cyj_uk.dat  (UK)
The convenience yields in each file follow the order presented in
Table 7 (paper) and Table A.1 (online appendix) which is:
 (Foodstuffs)
  1. Cocoa, 2. Coffee, 3. Orange, 4. Sugar
 (Grains)
  5. Canola, 6. Corn, 7. Oats, 8. Soybeans, 9. Soybean Oil, 10. Wheat
 (Industrials)
  11. Cotton, 12. Lumber
 (Meats)
  13. Cattle (Feeder), 14. Cattle (Live), 15. Hogs, 16. Pork Bellies
 (Metals)
  17. Copper, 18. Gold, 19. Palladium, 20. Platinum, 21. Silver
 (Energy)
  22. Crude Oil, 23. Heating Oil

Data (ASCII) files for real commodity prices (in local currency):
 HP-detrended: qj.dat (USA), qj_can.dat (Canada), qj_jap.dat (Japan)
 	       qj_fra.dat (France), qj_ger.dat (Germany),
  	       qj_ita.dat (Italy), qj_uk.dat (UK)
 One-sided MA: qj_onesided.dat (USA), qj_onesided_can.dat (Canada),
	       qj_onesided_jap.dat (Japan), qj_onesided_fra.dat
	       (France), qj_onesided_ger.dat (Germany),
	       qj_onesided_ita.dat (Italy), qj_onesided_uk.dat (UK)
The order of the commodities is the same as the one presented above.

Data (ASCII) files for IMF commodity index, spot commodity price 
changes, unemployment rate, CPI index, interest and exchange rates:
 imf_index_monthly.dat   (IMF aggregate commodity price index)
 ds.dat                  (log changes in spot commodity prices, in percent)
 us_cpi_monthly.dat      (US CPI indeces: all items, less food and energy, 
 		          less food, less energy, food, energy)
 us_intrate_monthly.dat  (US 3-month T-bill rate)
 usd_monthly_ave.dat     (USD trade-weighted index)
 us_unempl.dat           (US unemployment rate)
 cpi_monthly_oecd.dat    (other G-7 countries' CPI indeces: all items)
 irates_monthly_oecd.dat (other G-7 countries' interest rates)
 erates_monthly_oecd.dat (other G-7 exchange rates against USD)
